﻿
using System;
using System.Collections.Generic;
using System.Reflection;
namespace DQYT.HTDZ.Model
{
	/// <summary>
	/// 采集数据表项目中采集数据的来源信息以及用于数据描图部分的数据
	/// </summary>
	[Serializable]
	public partial class BDDATESOURCEModel
	{
		public BDDATESOURCEModel()
		{}
		#region Model
		private decimal _id;
		private string _wellid;
		private DateTime? _jcrq;
		private DateTime? _kssj;
		private DateTime? _jssj;
        private string _cjzsj;
		private decimal? _cjpl;
		private decimal? _cjzds;
		private decimal? _sccds;
		private decimal? _xccds;
		private decimal? _pullid;
		private decimal? _djid;
		private decimal? _pdgid;
		private string _gldw= " ";
		private string _jcdw =" ";
		private string _csr =" ";
		private string _cjsbxh= " ";
		private string _cjsbbb =" ";
		private string _scrjbb =" ";
		private byte[] _cjsj;
		/// <summary>
		/// 
		/// </summary>
		public decimal ID
		{
			set{ _id=value;}
			get{return _id;}
		}
		/// <summary>
		/// 
		/// </summary>
		public string WELLID
		{
			set{ _wellid=value;}
			get{return _wellid;}
		}
		/// <summary>
		/// 
		/// </summary>
		public DateTime? JCRQ
		{
			set{ _jcrq=value;}
			get{return _jcrq;}
		}
		/// <summary>
		/// 
		/// </summary>
		public DateTime? KSSJ
		{
			set{ _kssj=value;}
			get{return _kssj;}
		}
		/// <summary>
		/// 
		/// </summary>
		public DateTime? JSSJ
		{
			set{ _jssj=value;}
			get{return _jssj;}
		}
        public string CJZSJ
        {
            set { _cjzsj = value; }
            get { return _cjzsj; }
        }
		/// <summary>
		/// 
		/// </summary>
		public decimal? CJPL
		{
			set{ _cjpl=value;}
			get{return _cjpl;}
		}
		/// <summary>
		/// 
		/// </summary>
		public decimal? CJZDS
		{
			set{ _cjzds=value;}
			get{return _cjzds;}
		}
		/// <summary>
		/// 
		/// </summary>
		public decimal? SCCDS
		{
			set{ _sccds=value;}
			get{return _sccds;}
		}
		/// <summary>
		/// 
		/// </summary>
		public decimal? XCCDS
		{
			set{ _xccds=value;}
			get{return _xccds;}
		}
		/// <summary>
		/// 
		/// </summary>
		public decimal? PULLID
		{
			set{ _pullid=value;}
			get{return _pullid;}
		}
		/// <summary>
		/// 
		/// </summary>
		public decimal? DJID
		{
			set{ _djid=value;}
			get{return _djid;}
		}
		/// <summary>
		/// 
		/// </summary>
		public decimal? PDGID
		{
			set{ _pdgid=value;}
			get{return _pdgid;}
		}
		/// <summary>
		/// 
		/// </summary>
		public string GLDW
		{
			set{ _gldw=value;}
			get{return _gldw;}
		}
		/// <summary>
		/// 
		/// </summary>
		public string JCDW
		{
			set{ _jcdw=value;}
			get{return _jcdw;}
		}
		/// <summary>
		/// 
		/// </summary>
		public string CSR
		{
			set{ _csr=value;}
			get{return _csr;}
		}
		/// <summary>
		/// 
		/// </summary>
		public string  CJSBXH
		{
			set{ _cjsbxh=value;}
			get{return _cjsbxh;}
		}
		/// <summary>
		/// 
		/// </summary>
		public string CJSBBB
		{
			set{ _cjsbbb=value;}
			get{return _cjsbbb;}
		}
		/// <summary>
		/// 
		/// </summary>
		public string SCRJBB
		{
			set{ _scrjbb=value;}
			get{return _scrjbb;}
		}
     
		/// <summary>
		/// 
		/// </summary>
		public byte[] CJSJ
		{
			set{ _cjsj=value;}
			get{return _cjsj;}
		}
		#endregion Model
        /// <summary>
        /// 通过一个属性的名字，给这个类中的这个属性赋值
        /// </summary>
        /// <param name="nodes"></param>
        public void SetPropertyValue(List<SJCJTextHeadNode> nodes)
        {
            foreach (SJCJTextHeadNode node in nodes)
            {
                if (string.IsNullOrWhiteSpace(node.DataName))
                    continue;
                PropertyInfo property = this.GetType().GetProperty(node.DataName);
                if (property == null)
                    continue;
                Type targetType = property.PropertyType;
                if (Nullable.GetUnderlyingType(targetType) != null)
                {
                    targetType = Nullable.GetUnderlyingType(targetType);
                }
                this.GetType().GetProperty(node.DataName).SetValue(this, Convert.ChangeType(node.DataValue, targetType), null);
                
            }
        }

	}
}

